package controller;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;

import model.BoardDAO;
import vo.ListVO;

public class ListAction implements Action {
	private Logger logger = Logger.getLogger(ListAction.class);
	@Override
	public ActionForward execute(HttpServletRequest request,
			HttpServletResponse response) throws ServletException {
		String path = "";
		BoardDAO boardDAO = BoardDAO.getInstance();
		
		ListVO lvo = boardDAO.getBoardList();
		lvo.setPostCount(boardDAO.getPostCount());
		logger.debug("result: " + lvo);
		
		request.setAttribute("boardList", lvo);
		path = "/board/get_list.jsp";
		
		
		return new ActionForward(path, false);
	}

}
